<extend name="Public:base" />
<block name="Controller">Info</block>
<block name="Main">
    <div class="col-md-10 main padding">
        <div class="cl">
            <div class="fl"><h2>信息管理</h2></div>
            <div class="fr">
                <a class="btn btn-primary" href="{:U('Admin/Info/add')}">新增信息</a>
            </div>
        </div>
        <div class="cf"></div>
        <div class="maigin-none">
            <a href="{:U("Admin/Nav/add")}" class="btn btn-success btn-sm" >新增分类</a>
            <a class="btn btn-sm btn-primary" navid="0" href="{:U("Admin/Info/index?navid=0")}" >所有</a>
            <volist name="navs" id="nav">
            <a navid="{$nav.id}" href="{:U("Admin/Info/index?navid=$nav[id]")}" >{$nav.name}</a>
            </volist>
        </div>



    </div>

<load href="Public/fancyBox/jquery.fancybox.css" />
<script type="text/javascript">
$(function(){
    $('a[navid={$navid}]').addClass('btn-primary');
    $('a[delete]').on('click',function(e){
        e.preventDefault();
        TukTuk.Modal.loading();
        var obj = $(this);
        var url = $(this).attr('href');
        $.get(url,{},function(req){
            obj.parent().parent().hide('slow',function(){
                obj.parent().parent().remove();
                TukTuk.Modal.hide();
            });
        })
    })
})    
</script>
</block>